package com.oujiong.websocket.service;

import com.oujiong.websocket.model.testModel;
import org.springframework.web.bind.annotation.PostMapping;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class testDemo {
    @PostMapping("/test")
    public void test(testModel testModel) {
        testModel demo = testModel;
        System.out.println(demo);
    }

    public static void main(String[] args) {
        long time0 = System.currentTimeMillis();
        //格式化日期实例sdf
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //创建Calendar 对象
        Calendar calendar = Calendar.getInstance();
//调用add方法给当前日期增加100天
        calendar.add(Calendar.YEAR, 100);
        //返回100天后的时间赋值给finalDate
        Date finalDate = calendar.getTime();
// 打印日期
        long time1 = System.currentTimeMillis();
        System.out.println(time1 - time0);
        System.out.println("*******" + sdf.format(finalDate) + "********");


    }
}
